package com.samuel.jdbc;

import java.sql.Connection;

import com.mysql.jdbc.jdbc2.optional.MysqlDataSource;

public class JDBCUtil {
	private static String url = "jdbc:mysql://127.0.0.1:3306/test";
	private static String userName = "root";
	private static String password = "";

	public static Connection getConnection() throws Exception {
		MysqlDataSource ds = new MysqlDataSource();
		ds.setURL(url);
		ds.setUser(userName);
		ds.setPassword(password);
		return ds.getConnection();
	}
}
